package com.liner.work;

import java.util.Arrays;
import java.util.Random;

public class Test {
    public static void main(String[] args) {
        String[] redBlueBalls = {"01","02","03","04","05",
                "06","07","08","09","10","11","12","13",
                "14","15","16","17","18","19","20","21",
                "22","23","24","25","26","27","28","29",
                "30","31","32","33"};
        String[] redBalls = new String[6];
        boolean[] f = new boolean[redBlueBalls.length];
        Random r = new Random();
        for(int i=0;i<redBalls.length;i++){
            int index = r.nextInt(redBlueBalls.length);
            if(f[index]){
                i--;
            }else {
                redBalls[i] = redBlueBalls[index];
                f[index] = true;
            }
        }
        Arrays.sort(redBalls);
        System.out.println(Arrays.toString(redBalls));
        String blueBall = redBlueBalls[r.nextInt(16)];
        redBalls = Arrays.copyOf(redBalls,redBalls.length+1);
        redBalls[redBalls.length-1] = blueBall;
        System.out.println(Arrays.toString(redBalls));
    }
}
